
import { getAiCateConfig } from "@/api";
import { CateChildType, CateType, CateConfig } from '@/types/apiResType'


export interface ICateConfig {
    isShowCateInfo: boolean,
    aiCateConfig: CateConfig,
    setShowCateInfo:(status:boolean)=>void
    initAiCateConfig: (cateid: string) => void
}

const CateConfig = (): ICateConfig => {
    return {
        isShowCateInfo: true,
        aiCateConfig: {
            cateid: "",
            name: "",
            classify_id: "",
            prompt: "",
            description:'',
            list: []
        },
        setShowCateInfo(status){this.isShowCateInfo=status},
        async initAiCateConfig(cateid: string) {
            const res = await getAiCateConfig({ cateid })
            if (res.code) {
                this.aiCateConfig = res.data
            }
        }
    };
};

export default CateConfig;
